package com.briup.demo.dao;

import com.briup.demo.bean.discount;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface discountMapper {
    @Select("select * from discount")
    List<discount> selectAll();

    @Insert("insert into discount values(null,#{name},#{rebate},#{category},#{category_id},#{price},#{rebate_price})")
    void insert(discount discount);
    @Update("update discount set name=#{name},rebate=#{rebate},category=#{category},category_id=#{category_id},price=#{price},rebate_price=#{rebate_price} where id=#{id}")
    void update(discount discount);
    @Delete("delete from discount where id=#{id}")
    void delete(Long id);
}
